package com.cn.study004;

import java.util.Scanner;

/**
 * @author lw
 * @ClassName Calculator.java
 * @Description
 * @createTime 2023年05月11日 13:56:00
 */
public class Calculator {
    public static void main(String[] args) {
        Scanner sc= new Scanner(System.in);
        System.out.println("请输入第一个数");
        int i=sc.nextInt();
        System.out.println("请输入第二个数");
        int j=sc.nextInt();
        System.out.println("请输入操作：");
        String string = sc.next();
        switch (string){
            case "+":
                System.out.println(i+string+j+"="+(i+j));
                break;
            case "/":
                System.out.println(i+string+j+"="+(i/j));
                break;
            case "*":
                System.out.println(i+string+j+"="+(i*j));
                break;
            case "-":
                System.out.println(i+string+j+"="+(i-j));
                break;
            case "%":
                System.out.println(i+string+j+"="+(i%j));
                break;
            default:
                System.out.println("输入错误！");
        }

    }
}
